package yxy.game.pm2.module.wuchao.event;

import yxy.cherry.data.bean.wuchaoitem;
import yxy.game.pm2.bean.Currency;
import yxy.game.pm2.message.WuchaoMessage;
import yxy.game.pm2.module.CurrencyHandle;

/** 乌巢事件 掉落 */
public class WuchaoEventDrop extends WuchaoEvent {
	@Override
	public EventType getEventType() {
		return EventType.Drop;
	}

	@Override
	protected void _packageInfo(WuchaoMessage.WuchaoEvent.Builder builder) {
		builder.setItem(new CurrencyHandle().packItem(getDrop()));
	}

	private Currency drop;

	public void setDrop(Currency drop) {
		this.drop = drop;
	}

	public Currency getDrop() {
		return drop;
	}

	public static WuchaoEventDrop create(wuchaoitem data) {
		WuchaoEventDrop event = new WuchaoEventDrop();
		event.setDrop(Currency.create(data.getItemtype(), data.getItemid(), data.getItemnum()));
		return event;
	}
}
